using System;
using System.Collections.Generic;
using System.Text;
using UnityEngine.Serialization;
using UnityEngine.U2D;
using UnityEngine.UI;
using UnityEngine;
using UnityEditor;

namespace SgsUI
{
    public class SpriteRes : Image
    {
        public enum Source
        {
            res,

            plist,

            remote
        }

        public Source m_source = Source.plist;

        public string GetResName()
        {
            if(!sprite)
            {
                return String.Empty;
            }
                

            if(m_source == SpriteRes.Source.plist)
            {
                return "#" + sprite.name + ".png";
            }
            else
            {
                string res = AssetDatabase.GetAssetPath(sprite.GetInstanceID());
                return res.Replace("Assets/Res/","");
            }
        }
    }
}